package com.sgroup.studycountry.infrastructure.hanlder;

import com.sgroup.studycountry.support.rest.R;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

/**
 * @author umi
 * @date 2021/10/27 20:00
 */
@RestControllerAdvice
public class ExceptionResponseHandler {
    @ExceptionHandler(Exception.class)
    public R<?> sendException(Exception exception) {
        return R.fail(exception.getMessage());
    }
}